package com.zyong.design.pattern.flyweight.case2;

/**
 * 具体享元类:坦克
 * @program: zyong-design-pattern
 * @ClassName: Tank
 * @author: zyong
 * @create: 2024-04-06 10:42
 */
public class Tank extends AbstractGameRole {
    private String color;
    private String speed;
    private String gun;

    public Tank(TankType tankType) {
        setColor(tankType.getColor());
        setSpeed(tankType.getSpeed());
    }

    public void openFire() {
        System.out.println("坦克在开火");
    }

    @Override
    public void move() {
        System.out.println("坦克在移动");
    }

    public String getColor() {
        return color;
    }

    private void setColor(String color) {
        this.color = color;
    }

    public String getSpeed() {
        return speed;
    }

    private void setSpeed(String speed) {
        this.speed = speed;
    }

    public String getGun() {
        return gun;
    }

    public void setGun(String gun) {
        this.gun = gun;
    }
}
